<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/10/21 0021
 * Time: 17:23
 */
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\LinkPager;

?>
<link href="./css/blog.css" rel="stylesheet">
<div class="container">

    <div class="blog-header">
        <h1 class="blog-title">The Help friends Blog</h1>
        <p class="lead blog-description">Help friends blog welcome you to join.</p>
    </div>

    <div class="row">

        <div class="col-sm-8 blog-main">

            <div class="blog-post">
                <?php foreach ($articleall as $country):?>
                    <a href="index.php?r=filecomment/comment&id=<?=Html::encode("{$country->id}")?>"><h2 class="blog-post-title"><?=Html::encode(" {$country->title}")?></h2></a>
                    <p class="blog-post-meta"><?=Html::encode(" {$country->now}")?><a href="#"><?=Html::encode(" {$country->author}")?></a></p>
                    <p><?=Html::encode(" {$country->content}")?></p>
                    <form method="post" action="<?php echo Url::to(['filecomment/addcomment'])?>">
                        <div class="mod-body">
                            <h5>评论:</h5>
                            <div class="aw-mod aw-editor-box">
                                <?php if (Yii::$app->session->has('regname')){?>
                                    <input id="fid" name="fid" type="hidden" value="<?=Html::encode("{$country->id}")?>"/>
                                    <div class="mod-head">
                                        <div class="wmd-panel">
                                            <div id="wmd-button-bar"></div>
                                            <textarea class="wmd-input form-control autosize" id="question_detail" rows="2" name="question_detail"></textarea>
                                        </div>
                                    </div>
                                    <div class="mod-footer clearfix">
                                        <button class="btn btn-large btn-success pull-right" type="submit" name="login" id="loginButton">确认评论</button>
                                    </div>
                                <?php }else{?>
                                    <div class="mod-footer clearfix">
                                        <span>尊敬的用户您还没有
                                            <a  href="<?php echo Url::to(['site/login'])?>" >登录</a>，请先
                                            <a  href="<?php echo Url::to(['site/login'])?>" >登录</a>后再评论。如您还未
                                            <a  href="<?php echo Url::to(['site/registered'])?>" >注册 </a>账号，请先
                                            <a  href="<?php echo Url::to(['site/registered'])?>" >注册 </a>。</span>
                                    </div>
                                <?php } ?>
                            </div>
                        </div>
                    </form>
                    </br>
                <?php endforeach; ?>
                <?= LinkPager::widget(['pagination' => $pagination]) ?>
            </div><!-- /.blog-post -->

        </div><!-- /.blog-main -->

        <div class="col-sm-3 col-sm-offset-1 blog-sidebar">
            <div class="sidebar-module sidebar-module-inset">
                <div class="sidebar-module sidebar-module-inset">
                    <h4>Latest News</h4>
                    <ul>
                        <?php foreach ($countries as $country):?>
                            <li><a href="index.php?r=site/news-detailed&id=<?=Html::encode("{$country->id}")?>"><?=Html::encode(" {$country->title}")?>;</a>
                            </li>
                        <?php endforeach; ?>

                    </ul>
                </div>
            </div>
            <div class="sidebar-module">
                <h4>Celebrity</h4>
                <ol class="list-unstyled">
                    <ul>
                        <?php foreach ($r as $countrys):?>
                            <li><a href="index.php?r=user/friend&regname=<?=Html::encode("{$countrys->regname}")?>"><?=Html::encode(" {$countrys->regname}")?>;</a>
                            </li>
                        <?php endforeach; ?>
                    </ul>
                </ol>
            </div>
            <div class="sidebar-module">
                <h4>Elsewhere</h4>
                <ol class="list-unstyled">
                    <li><a href="http://bbs.houdunwang.com/forum-282-1.html"  target="_blank">YII2视频教程</a></li>
                    <li><a href="http://www.yiichina.com/doc/guide/2.0"  target="_blank">YII2官网</a></li>
                    <li><a href="http://edu.51cto.com/index.php?do=lesson&id=91056"  target="_blank">bootstrap视频教程</a></li>
                    <li><a href="http://v3.bootcss.com/"  target="_blank">bootstrap官方</a></li>
                </ol>
            </div>
        </div><!-- /.blog-sidebar -->

    </div><!-- /.row -->

</div><!-- /.container -->




